package com.my.study.io.transformation;

import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * @author Carlos
 * @version 1.0
 * @Description 字节流 -> 字符流
 *
 * @date 2021/6/27 11:51
 **/
public class OutputStreamWriterTest {

    private static final String PATH = "D:/file/tf.txt";

    public static void main(String[] args) {

        try (BufferedWriter writer = new BufferedWriter(
                new OutputStreamWriter(
                        new FileOutputStream(PATH), "gbk"))){
            writer.write("Hi! 解决的和！");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
